﻿using System.ComponentModel;

namespace Monti.MVVM
{
   /// <summary>
   /// Base class for any view model.
   /// </summary>
   public abstract class ViewModelBase : INotifyPropertyChanged
   {
      #region INotifyPropertyChanged Members

      /// <summary>
      /// Raised when a property on this object has a new value.
      /// </summary>
      public event PropertyChangedEventHandler PropertyChanged;

      /// <summary>
      /// Raises this object's PropertyChanged event.
      /// </summary>
      /// <param name="propertyName">The property that has a new value.</param>
      protected void RaisePropertyChanged (string propertyName)
      {
         if (this.PropertyChanged != null)
            this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
      }

      #endregion
   }
}
